<?php

class Application_Form_Category extends Zend_Form
{
    public function init()
    {
        $this->setName('Category');

        $category_id = new Zend_Form_Element_Hidden('category_id');
        $category_id->addFilter('Int');

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Tên')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
        
             
        $slug = new Zend_Form_Element_Text('slug');
        $slug->setLabel('Slug')
          
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
               
               
               
               
//        $left_id = new Zend_Form_Element_Text('left_id');
//        $left_id->setLabel('left_id')
//        					  ->addFilter('Int');
//
//        $right_id = new Zend_Form_Element_Text('right_id');
//        $right_id->setLabel('right_id')
//        					  ->addFilter('Int');
//        					  
//        $parent_id = new Zend_Form_Element_Text('parent_id');
//        $parent_id->setLabel('parent_id')
//        					  ->addFilter('Int');
        					  
        
               
        $language = new Zend_Form_Element_Select('language');
        $language->setLabel('Ngôn ngữ :')
                ->setRequired(true)
                ->addMultiOptions(array(
                 	'en' => 'English',
                	'vi' => 'VietNam'
        ));
       	$submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'AddButton');

        $cancel = new Zend_Form_Element_Submit('cancel');
        $cancel->setAttrib('id', 'CancelButton');
        
        

        $this->addElements(array($name, $slug, $language, $category_id, $submit, $cancel));
    }
}